/**
 * Created by lenovo on 19/6/6 006.
 */

var totop = document.querySelector("#totop");
//判断距离顶部的距离，如果大于1000就显示返回顶部否则就不显示
window.onscroll = function(){
/*
    console.log(document.documentElement.scrollTop);
*/
    if(document.documentElement.scrollTop > 1000){
        totop.style.display = 'block';
    }else{
        totop.style.display = 'none';
    }
};
//点击事件，返回顶部
totop.addEventListener('click',function(){
    /*window.scrollTo(0,0);*/
   window.scrollTo({
       top:0,
       behavior:'smooth'
   })
});

//点赞
var num = document.querySelector("#zan1").innerHTML;
num = Number(num);
function zan(){
    if (document.querySelector("#zan1").innerHTML == 140){
        document.querySelector("#zan1").innerHTML = num+1;
        document.querySelector("#zan1").style.color = "red";
        document.querySelector()
    }else{
        document.querySelector("#zan1").innerHTML = num+1-1;
        document.querySelector("#zan1").style.color = "#000";
    }
}